package lesson4.pages;

import lesson4.api.ApplicationManager;
import lesson4.api.base.PageBase;
import lesson4.pages.locators.page.UserMenuLocators;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class UserMenu extends PageBase
{
	// Logger
	private static Logger log = LoggerFactory.getLogger(UserMenu.class);
	// Locators
	private final UserMenuLocators locators;

	public UserMenu(ApplicationManager p_app)
	{
		super(p_app);
		locators = new UserMenuLocators(p_app);
	}

	public boolean isLinkLogoutPresent()
	{
		return isElementPresent(locators.linkLogout());
	}

	public void logout()
	{
		log.info("Logout through user menu");
		click(locators.linkLogout());
	}

}
